package java1;

import java.util.*;

public class Take_number {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		while (in.hasNextInt()) {
			int a = in.nextInt();
			if(a>=10000&&a<=20000) {
			System.out.printf(Integer.toBinaryString(a) + ',');
			System.out.printf(Integer.toOctalString(a) + ',');
			System.out.println(Integer.toHexString(a));
			}
			else {
				if (a < 0) a = -a;
				String str1 = Integer.toString(a), str2;
				int sum = 0;
				for (int i = 0; i < str1.length(); i++) {
					str2 = str1.substring(i, i+1);
					System.out.print(str2 + " ");
					sum += Integer.parseInt(str2);
				}
			System.out.println(sum);
			}
		}
	}
}
